#ifndef __KEY_H
#define __KEY_H


#include "stm32f37x.h"
#include "led.h"


#define 	    DOWN_KEY    	0
#define  	    UP_KEY          1
#define         LONG_KEY        2
#define         NULL_KEY        3
#define         DD_KEY          4


#define         KEY_ON          0
#define         KEY_OFF         1

#define         LONG_TIME       50
#define         SIGNAL_TIME     3


 #define        key_read(x_port, x_pin)      GPIO_ReadInputDataBit(x_port, x_pin)

typedef enum key_state
{
        KEY_STATE_0,
        KEY_STATE_1,
        KEY_STATE_2,
        KEY_STATE_3,
    
}KEY_STATE;


u8 x_io_scan(GPIO_TypeDef * x_port, uint16_t x_pin);
u8 dd_press(GPIO_TypeDef * x_port, uint16_t x_pin);



#endif